﻿using System.Collections.Generic;
using System.Linq;

namespace Whoot
{
    public abstract class TaskList : Task
    {
        protected readonly List<Task> Tasks = new List<Task>();

        public override float Progress
        {
            get
            {
                var cur = Tasks.Sum(t => t.Progress);
                return cur / (float) Tasks.Count;
            }
            protected set { }
        }

        public TaskList Append(Task action)
        {
            this.Tasks.Add(action);
            return this;
        }
    }
}